package com.buka.controller;

import com.buka.service.HotelService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/tf")
public class TfServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //先获取房间号
        String roomNumStr = req.getParameter("roomNum");
        int rootNum = Integer.parseInt(roomNumStr);
        //调用service层方法
        HotelService hotelService = new HotelService();
        int row = hotelService.tf(rootNum);
        //重定向到首页
        resp.sendRedirect("index");

    }
}
